水無瀬の部屋 > Programming > sample > tools > header > toolwind.h |
---|
1: //*********************************************************
2: // プロジェクト: TOOLS
3: // ファイル名: toolwind.h
4: //*********************************************************
5: #ifndef TOOLWIND_HEAD_INCLUDED // 多重インクルードの防止
6: #define TOOLWIND_HEAD_INCLUDED
7:
8:
9: //*********************************************************
10: // コンパイル環境の指定
11: //*********************************************************
12: #ifndef PRIVATE_TOOLS_HEAD_INCLUDED // 冗長ガード
13: #include <header/_tools.h>
14: #ifndef PRIVATE_TOOLS_HEAD_INCLUDED // ガード名の検査
15: #error "? PRIVATE_TOOLS_HEAD_INCLUDED"
16: #endif // #ifndef PRIVATE_TOOLS_HEAD_INCLUDED
17: #endif // #ifndef PRIVATE_TOOLS_HEAD_INCLUDED
18:
19:
20: //*********************************************************
21: // C 標準ヘッダ の インクルード
22: //*********************************************************
23: #include <limits.h> // SHRT_MAX => MAX_MENUTEXTLENGTH
24:
25:
26: //*********************************************************
27: // マクロ の 定義
28: //*********************************************************
29: //
30: #define MAX_MENUTEXTLENGTH ( SHRT_MAX ) // たぶんメニュー文字列の最大長
31:
32: //
33: #define INVALID_MENUITEMID ( 0xFFFFFFFF ) // 無効な項目識別子
34: #define INVALID_MENUITEMSTATE ( 0xFFFFFFFF ) // 無効なメニューの状態
35:
36: //
37: #if ( WINVER < 0x0500 )
38: #define TPM_RECURSE ( 0x0001L )
39: #define TPM_HORPOSANIMATION ( 0x0400L )
40: #define TPM_HORNEGANIMATION ( 0x0800L )
41: #define TPM_VERPOSANIMATION ( 0x1000L )
42: #define TPM_VERNEGANIMATION ( 0x2000L )
43: #define WM_MENURBUTTONUP ( 0x0122 )
44: #define WM_MENUDRAG ( 0x0123 )
45: #define WM_MENUGETOBJECT ( 0x0124 )
46: #define WM_UNINITMENUPOPUP ( 0x0125 )
47: #define WM_MENUCOMMAND ( 0x0126 )
48: #endif // #if ( WINVER < 0x0500 )
49:
50: //
51: #if ( _WIN32_WINNT < 0x0500 )
52: #define TPM_NOANIMATION ( 0x4000L )
53: #endif // #if ( _WIN32_WINNT < 0x0500 )
54:
55: //
56: #if ( _WIN32_WINNT < 0x0501 )
57: #define TPM_LAYOUTRTL ( 0x8000L )
58: #endif // #if ( _WIN32_WINNT < 0x0501 )
59:
60: //
61: #define MAX_CLASSNAME ( 1024 ) // ???
62: #define MAX_TITLE ( SHRT_MAX ) // ???
63: #define SetWindowCursor(hWnd,hCursor) SetClassCursor((hWnd),(hCursor))
64:
65: //
66: #define WM_APP_MAX ( 0xBFFF ) //
67: #define WM_USER_MAX ( 0x7FFF ) //
68: #define SendCommand(hwnd,wID) (SendMessage((hwnd),WM_COMMAND,MAKEWPARAM((wID),0),0))
69: #define PostCommand(hwnd,wID) (PostMessage((hwnd),WM_COMMAND,MAKEWPARAM((wID),0),0))
70:
71: //
72: #ifdef _WIN64
73: #define GetClassLongPtr64( w, i ) GetClassLongPtr( w, i )
74: #define SetClassLongPtr64( w, i ) SetClassLongPtr( w, i, l )
75: #define GetWindowLongPtr64( w, i, l ) GetWindowLongPtr( w, i )
76: #define SetWindowLongPtr64( w, i, l ) SetWindowLongPtr( w, i, l )
77: #define SubclassWindow64( w, f ) SubclassWindow( w, f )
78: #else
79: #define GetClassLongPtr64( w, i ) ((ULONG_PTR)GetClassLong( w, i ))
80: #define SetClassLongPtr64( w, i, l ) ((ULONG_PTR)SetClassLong( w, i, (LONG)(l) ))
81: #define GetWindowLongPtr64( w, i ) ((LONG_PTR)GetWindowLong( w, i ))
82: #define SetWindowLongPtr64( w, i, l ) ((LONG_PTR)SetWindowLong( w, i, (LONG)(l) ))
83: #define SubclassWindow64( w, f ) ((WNDPROC)SetWindowLongPtr64( w, GWLP_WNDPROC, (LONG_PTR)static_cast<WNDPROC>(f) ))
84: #endif
85:
86:
87: //*********************************************************
88: // 関数 の 宣言
89: //*********************************************************
90: #ifdef __cplusplus
91: extern "C" {
92: #endif
93:
94:
95: // toolwind.cpp
96: // a
97: char *AllocDlgItemText( HWND hWnd, int nID );
98: char *AllocWindowText( HWND hWnd );
99:
100: // b
101: // c
102: bool CenterWindow( HWND hChild, HWND hParent );
103: bool ClientToWindow( HWND hWnd, POINT *pt );
104: bool ClientRectToScreenRect( HWND hWnd, RECT *rc );
105: HWND CreateChildWindow( DWORD dwExStyle, const char *ClassName, const char *text, DWORD dwStyle, int x, int y, int width, int height, HWND hParent, UINT uID, HINSTANCE hInstance, void *param );
106: HWND CreateWindowIndirect( const CREATESTRUCT *cs );
107: bool CursorInClient( HWND hWnd );
108:
109: // d
110: HDWP DeferWindowMove( HDWP *hWinPosInfo, HWND hWnd, int XPos, int YPos );
111: INT_PTR DialogBoxPtrParam( HINSTANCE hInstance, const char *name, HWND hwndParent, DLGPROC proc, const void *param );
112:
113: // e
114: bool EnableDlgItem( HWND hWnd, int nID, bool bEnable );
115:
116: // f
117: // g
118: HBRUSH GetClassBrush( HWND hWnd );
119: HCURSOR GetClassCursor( HWND hWnd );
120: HICON GetClassIcon( HWND hWnd, WPARAM fType );
121: HMODULE GetClassModule( HWND hWnd );
122: DWORD GetClassStyle( HWND hWnd );
123: int GetClientHeight( HWND hWnd );
124: bool GetClientSize( HWND hWnd, SIZE *size );
125: int GetClientWidth( HWND hWnd );
126: bool GetCurrentDisplaySetting( DEVMODE *dev );
127: int GetDlgItemBottom( HWND hWnd, int ctrl );
128: int GetDlgItemTextLength( HWND hWnd, int nID );
129: UINT GetDragFileCount( HDROP hDrop );
130: int GetDlgItemTop( HWND hWnd, int ctrl );
131: int GetMenuItemPos( HMENU hMenu, UINT uID );
132: int GetMenuStringLength( HMENU hMenu, UINT uID, UINT flag );
133: HWND GetNextDlgItem( HWND hDlg, int nID );
134: UINT_PTR GetNotifyMessageControlID( LPARAM lParam );
135: UINT GetNotifyMessageNotifyCode( LPARAM lParam );
136: NMHDR *GetNotifyMessageParam( LPARAM lParam );
137: HWND GetNotifyMessageWindow( LPARAM lParam );
138: bool GetScreenRect( RECT *rcScreen );
139: int GetWindowBottom( HWND hWnd );
140: int GetWindowHeight( HWND hWnd );
141: HICON GetWindowIcon( HWND hWnd, WPARAM fType );
142: bool GetWindowLogFont( HWND hWnd, LOGFONT *lf );
143: int GetWindowNormalHeight( HWND hWnd );
144: int GetWindowNormalWidth( HWND hWnd );
145: bool GetWindowNormalRect( HWND hWnd, RECT *pRect );
146: bool GetWindowPoint( HWND hWnd, POINT *ppt );
147: bool GetWindowPriority( HWND hWnd, DWORD *dwPriorityClass );
148: bool GetWindowSize( HWND hWnd, SIZE *size );
149: int GetWindowTop( HWND hWnd );
150: int GetWindowWidth( HWND hWnd );
151: bool GetWorkareaRect( RECT *rcWorkarea );
152:
153: // h
154: // i
155: bool InvalidateDlgItem( HWND hWnd, int nID, bool bErase );
156: bool InvalidateWindow( HWND hWnd, bool bErase );
157: bool IsClassNameWindow( HWND hWnd, const char *ClassName );
158: bool IsDlgItemEnabled( HWND hWnd, int nID );
159: bool IsDlgItemVisible( HWND hWnd, int nID );
160: bool IsMenuItemChecked( HMENU hMenu, UINT uID, UINT flag );
161: bool IsValidCharMessageParam( WPARAM wParam, LPARAM lParam );
162: bool IsValidCommandMessageParam( WPARAM wParam, LPARAM lParam );
163: bool IsValidControlColorStaticMessageParam( WPARAM wParam, LPARAM lParam );
164: bool IsValidControlColorDialogMessageParam( WPARAM wParam, LPARAM lParam );
165: bool IsValidDlgItem( HWND hWnd, int nID );
166: bool IsValidInitDialogMessageParam( WPARAM wParam, LPARAM lParam );
167: bool IsValidInitMenuPopupMessageParam( WPARAM wParam, LPARAM lParam );
168: bool IsValidKeyDownMessageParam( WPARAM wParam, LPARAM lParam );
169: bool IsValidMenuSelectMessageParam( WPARAM wParam, LPARAM lParam );
170: bool IsValidMenu( HMENU hMenu );
171: bool IsValidMenuString( const char *title );
172: bool IsValidNotifyMessageParam( WPARAM wParam, LPARAM lParam );
173: bool IsValidSetCursorMessageParam( WPARAM wParam, LPARAM lParam );
174: bool IsValidSystemCommandMessageParam( WPARAM wParam, LPARAM lParam );
175: bool IsValidWindow( HWND hWnd );
176: bool IsValidWindowClass( const WNDCLASSEX *wc );
177: bool IsValidWindowPosChangingMessageParam( WPARAM wParam, LPARAM lParam );
178: bool IsWindowNotifyMessageParam( HWND hWnd, LPARAM lParam );
179: bool IsWindowTopmost( HWND hWnd );
180:
181: // j
182: // k
183: // l
184: // m
185: bool MakeNotifyStruct( NMHDR *hdr, HWND hWnd, UINT code );
186: bool MakeWindowClass( WNDCLASSEX *wc, HINSTANCE hInstance, WNDPROC WndProc, const char *ClassName, const char *MenuName, UINT style );
187: bool MaximizeWindow( HWND hWnd );
188: bool Menu_AppendSeparator( HMENU hMenu );
189: DWORD Menu_CheckItem( HMENU hMenu, UINT uID, UINT flag, bool bCheck );
190: bool Menu_EnableItem( HMENU hMenu, UINT uID, UINT flag, bool bEnable );
191: bool Menu_InsertSeparator( HMENU hMenu, UINT uID, UINT flag );
192: bool MinimizeWindow( HWND hWnd );
193:
194: // n
195: // o
196: // p
197: bool PopupMenu( HWND hwndOwner, HMENU hMenuPopup, const POINT *pt, UINT flags );
198: bool PopupMenuEx( HWND hwndOwner, HMENU hMenuPopup, const POINT *pt, UINT flags, const RECT *rc );
199: bool PopupMenuCursorPos( HWND hwndOwner, HMENU hMenu, UINT flags );
200: bool PopupMenuCursorPosEx( HWND hwndOwner, HMENU hMenu, UINT flags, const RECT *rc );
201: bool PopupSubMenu( HINSTANCE hInstance, const char *menu, int pos, HWND hwndOwner, const POINT *pt, UINT flags );
202: bool PopupSubMenuEx( HINSTANCE hInstance, const char *menu, int pos, HWND hwndOwner, const POINT *pt, UINT flags, const RECT *rc );
203: bool PopupSubMenuCursorPos( HINSTANCE hInstance, const char *name, int pos, HWND hwndOwner, UINT flags );
204: bool PopupSubMenuCursorPosEx( HINSTANCE hInstance, const char *name, int pos, HWND hwndOwner, UINT flags, const RECT *rc );
205:
206: // q
207: // r
208: bool ResetWindowTopmost( HWND hWnd );
209: bool RestoreWindow( HWND hWnd );
210:
211: // s
212: bool ScreenRectToClientRect( HWND hWnd, RECT *rc );
213: bool ScreenToWindow( HWND hWnd, POINT *pt );
214: LRESULT SendNotifyCommand( HWND hCtrl, WORD wNotifyCode );
215: HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush );
216: HCURSOR SetClassCursor( HWND hWnd, HCURSOR hCursor );
217: HICON SetClassIcon( HWND hWnd, WPARAM fType, HICON hIcon );
218: DWORD SetClassStyle( HWND hWnd, DWORD dwStyle );
219: HDWP SetDeferWindowSize( HDWP *hWinPosInfo, HWND hWnd, int width, int height );
220: HWND SetDlgItemFocus( HWND hWnd, int nID );
221: bool SetMenuString( HMENU hMenu, UINT uID, UINT flag, const char *string );
222: //ATOM SetWindowClass( HINSTANCE hInstance, const char *ClassName, WNDPROC WndProc, UINT uStyle, const char *MenuName, int nBrush );
223: DWORD SetWindowExStyle( HWND hWnd, DWORD dwExStyle );
224: HICON SetWindowIcon( HWND hWnd, WPARAM fType, HICON hIcon );
225: bool SetWindowPriority( HWND hWnd, DWORD PriorityClass );
226: bool SetWindowSize( HWND hWnd, int width, int height );
227: DWORD SetWindowStyle( HWND hWnd, DWORD dwStyle );
228: bool SetWindowTopmost( HWND hWnd );
229: HDWP ShiftDeferDlgItemSize( HDWP *phWinPosInfo, HWND hWnd, int nID, int nX, int nY );
230: HDWP ShiftDeferDlgItem( HDWP *phWinPosInfo, HWND hWnd, int nID, int nShiftPosX, int nShiftPosY, int nShiftSizeX, int nShiftSizeY );
231: HDWP ShiftDeferWindow( HDWP *phWinPosInfo, HWND hWnd, int shift_pos_x, int shift_pos_y, int shift_size_x, int shift_size_y );
232: HDWP ShiftDeferWindowPos( HDWP *hWinPosInfo, HWND hWnd, int nShiftX, int nShiftY );
233: HDWP ShiftDeferWindowSize( HDWP *hWinPosInfo, HWND hWnd, int nShiftX, int nShiftY );
234: bool ShiftDlgItemPos( HWND hWnd, int ctrl, int x, int y );
235: bool ShiftDlgItemSize( HWND hWnd, int nID, int nX, int nY );
236: bool ShiftWindowPos( HWND hWnd, int nShiftX, int nShiftY );
237: bool ShiftWindowSize( HWND hWnd, int nShiftX, int nShiftY );
238:
239: // t
240: bool TopmostWindow( HWND hWnd, bool bTopmost );
241:
242: // u
243: // v
244: bool VisibleDlgItem( HWND hWnd, int nID, bool bVisible );
245: bool VisibleWindow( HWND hWnd, bool bVisible );
246:
247: // w
248: bool WindowCaptionMoveToCursorPos( HWND hWnd );
249: bool WindowMove( HWND hWnd, int XPos, int YPos );
250: bool WindowMoveIntoWorkarea( HWND hWnd );
251: bool WindowMoveToCursorPos( HWND hWnd );
252: bool WindowToClient( HWND hWnd, POINT *pt );
253: bool WindowToScreen( HWND hWnd, POINT *pt );
254:
255: // x
256: // y
257: // z
258:
259:
260: #ifdef __cplusplus
261: } // extern "C"
262: #endif
263:
264:
265: #endif // #ifndef TOOLWIND_HEAD_INCLUDED
266:
267:
268: //** end **
269:
参照:
lnkctrl.cpp, picker.cpp, browsbox.cpp, toolmci.cpp, toolold.cpp, toolctrl.cpp, toolptrc.cpp, tools.h, toolsys.cpp, toolsysx.cpp, toolwind.cpp
水無瀬の部屋 > sample > tools > header > toolwind.h |
---|
このページは cpp2web が出力しました。
水無瀬 優 postmaster@katsura-kotonoha.sakura.ne.jp
http://katsura-kotonoha.sakura.ne.jp/prog/code/tools/header/toolwind_h.shtml